package com.cqut.dto;

import com.cqut.util.BeanUtil;
import com.cqut.util.StringUtil;
import com.cqut.validInterfaces.GroupForAdd;
import com.cqut.validInterfaces.GroupForUpdate;
import com.cqut.validInterfaces.GroupForUpdateExtra;
import com.cqut.model.RoleRigth;
import com.cqut.model.User;

import java.io.Serializable;

import org.hibernate.validator.constraints.NotEmpty;


public class UserDTO implements Serializable {
		@NotEmpty(message= "{general.NotEmpty}", groups = GroupForUpdate.class)
        private static final long serialVersionUID = 1L;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userName;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private Integer userType;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private Integer userSex;  /**1 男 2 女*/
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userNo;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userMailbox;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userPhone;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userCollege;
        
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String userPassword;//userPassword
		
		@NotEmpty(message= "{general.NotEmpty}", groups = { GroupForUpdate.class, GroupForUpdateExtra.class})
        private String roleId;

		public String userId;
		
		//所属角色id
	/*	@NotEmpty(message = "{general.NotEmpty}", groups = GroupForAdd.class)
		private String roleId;
		
		//角色权限分配id
		@NotEmpty(message = "{general.NotEmpty}", groups = GroupForAdd.class)
		private String roleRigthId;
        
        public String getRoleId() {
			return roleId;
		}

		public void setRoleId(String roleId) {
			this.roleId = roleId;
		}

		public String getRoleRigthId() {
			return roleRigthId;
		}

		public void setRoleRigthId(String roleRigthId) {
			this.roleRigthId = roleRigthId;
		}*/

		public String getRoleId() {
			return roleId;
		}

		public void setRoleId(String roleId) {
			this.roleId = roleId;
		}
		
		public String getUserId() {
			return userId;
		}

		public void setUserId(String userId) {
			this.userId = userId;
		}

		public String getUserName() {
            return this.userName;
        }
        
        public void setUserName(String userName) {
            this.userName = userName;
        }
        
        public Integer getUserType() {
            return this.userType;
        }
        
        public void setUserType(Integer userType) {
            this.userType = userType;
        }
        
        public Integer getUserSex() {
            return this.userSex;
        }
        
        public void setUserSex(Integer userSex) {
            this.userSex = userSex;
        }
        
        public String getUserNo() {
            return this.userNo;
        }
        
        public void setUserNo(String userNo) {
            this.userNo = userNo;
        }
        
        public String getUserMailbox() {
            return this.userMailbox;
        }
        
        public void setUserMailbox(String userMailbox) {
            this.userMailbox = userMailbox;
        }
        
        public String getUserPhone() {
            return this.userPhone;
        }
        
        public void setUserPhone(String userPhone) {
            this.userPhone = userPhone;
        }
        
        public String getUserCollege() {
            return this.userCollege;
        }
        
        public void setUserCollege(String userCollege) {
            this.userCollege = userCollege;
        }
        
        public String getUserPassword() {
            return this.userPassword;
        }
        
        public void setUserPassword(String userPassword) {
            this.userPassword = userPassword;
        }
        
        public User toModel() {
            User model = new User();
			BeanUtil.convert(this, model);
			return model;
        }

		public User toUser() {
			// TODO Auto-generated method stub
			User user = new User();
			return user;
		}
		
		/**
		 * 上传一个roleRigth对象
		 * */
		/*public RoleRigth toRoleRigth() {
			RoleRigth ua = new RoleRigth();
			
			ua.setRoleRightId(roleRigthId == null ? StringUtil.createTimestamp() : roleRigthId); 
			ua.setUserId(userId);
			ua.setRoleId(roleId);
			
			return ua;
		}*/
    
}